PV-on-HVM: Include compatability vmalloc_to_pfn for kernels before 2.6.10
authorIan Campbell <ian.campbell@xensource.com>
Wed, 25 Oct 2006 12:58:30 +0000 (13:58 +0100)
committerIan Campbell <ian.campbell@xensource.com>
Wed, 25 Oct 2006 12:58:30 +0000 (13:58 +0100)
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
unmodified_drivers/linux-2.6/platform-pci/platform-compat.c

index 191777a8ffdef4b5ee8313ab8adb438f25beec58..185a97449c857d64c79db00b5627db111b83ba76 100644 (file)
@@ -29,4 +29,8 @@
 #define nonseekable_open(inode, filp) /* Nothing to do */
 #endif
 
+#if defined(_LINUX_MM_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+unsigned long vmalloc_to_pfn(void *addr);
+#endif
+
 #endif
index 6538964ecf2aba3e08b6e4b8561eab2821bd6153..b79006bc219e4a1d5af0cd14458c06c18ea9c168 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/config.h>
 #include <linux/version.h>
 
+#include <linux/mm.h>
 #include <linux/module.h>
 
 #include <xen/platform-compat.h>
@@ -29,3 +30,14 @@ size_t strcspn(const char *s, const char *reject)
 }
 EXPORT_SYMBOL(strcspn);
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+/*
+ * Map a vmalloc()-space virtual address to the physical page frame number.
+ */
+unsigned long vmalloc_to_pfn(void * vmalloc_addr)
+{
+        return page_to_pfn(vmalloc_to_page(vmalloc_addr));
+}
+EXPORT_SYMBOL(vmalloc_to_pfn);
+#endif